Add Prisma migration for EscrowEvent table (#108) - #155
Conversation
The schema defined Dispute twice, which prevents prisma validate from succeeding in local workspaces. Keep the enum-backed definition used by seed and repositories. Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces an append-only EscrowEvent table mapping escrowId, optional fromState, toState, and createdAt for full lifecycle reconstruction. Co-authored-by: Cursor <cursoragent@cursor.com>
Connects the Escrow model to its append-only audit log so Prisma client queries can include event history via the ORM relation. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the migration folder and documents the EscrowEvent auditing purpose before applying structural DDL changes. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the EscrowEvent relation table with id, escrowId, fromState, toState, and createdAt columns matching the Prisma schema definition. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds escrowId lookup index and CASCADE foreign key so event rows are removed when parent escrows are deleted, matching the Prisma relation. Co-authored-by: Cursor <cursoragent@cursor.com>
Removes an Escrow back-relation that was never defined on Escrow, which blocked prisma validate from succeeding after the EscrowEvent schema work. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codellins Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Heads up @codellins, and thanks for the work here. Issue #108 has been closed as already implemented. The This PR adds a second migration, Nothing here is wrong with your work, the timing just overtook it. Flagging so you are not left waiting on a review. A maintainer will make the final call on closing. |
Summary
Adds the
EscrowEventPrisma model and a versioned SQL migration (20260530100000_add_escrow_event) for append-only escrow state-transition auditing. The table storesescrowId, optionalfromState,toState, andcreatedAt, with anescrowIdindex and CASCADE foreign key toEscrow. Also removes a duplicateDisputemodel and an orphanedVendorEscrowsrelation soprisma validatesucceeds in local workspaces.Verification
DATABASE_URL=postgresql://localhost:5432/trustlink npx prisma validate— schema valid-- CreateTable,-- CreateIndex,-- AddForeignKey)Closes #108
Made with Cursor